<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Person(name) {
            this.name = name;
        }

        Person.prototype.call = function () {
            console.log(this.name);
        }

        function NewObj() {  
            let obj = new Object();
            console.log(arguments);
            let Constructor = [].shift.call(arguments);
            
            obj.__proto__ = Constructor.prototype;
            let res = Constructor.apply(obj,arguments);

            return typeof res === 'object'?res:obj;
        }

        let xiaoming = NewObj(Person,'xiaoming');
        console.log(xiaoming);
        xiaoming.call();
    </script>
</body>

</html>